package com.hmz.backend.api;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

/**
 * 全局异常处理器
 *
 */
@RestControllerAdvice
public class RestExceptionHandler {
    @ExceptionHandler(Exception.class)
    public ResultData<String> exception(Exception e){
        System.out.println("捕获到了异常");
        return ResultData.fail(ReturnCode.RC999.getCode(), e.getMessage());
    }
}
